New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fylgja/details

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fylgja/details

The Fylgja details component

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Fylgja - Details

NPM version license

The details component enhances the default details behavior.

Installation

npm install @fylgja/details

Then include the component in to your code via;

@use "@fylgja/details";
// Or via PostCSS import
@import "@fylgja/details";

How to use

Out of the box all the styling is done directly, so no extra steps are needed.

And the details element wil look relativity the same as the browser default.

The style should be changeable for many purposes, think a sub menu toggle or a accordion.

Config

As with almost all of our components, CSS variables can be configured to add your own look/style.

Want direct control on the base styles, here are the following SCSS variables can you modify.

$details-animation: details-show 200ms ease-in-out !default;
$details-margin: 1em 0 !default;

Tip

If you need the common accordion style you can use the Card component, and a little extra CSS.

<style>
    .accordion {
        --card-elevation: none;
        --card-border: 1px solid #ccc;
        --card-padding: 0.5em 0.8em;
    }

    .accordion > details:first-of-type {
        border-radius: 4px 4px 0 0;
        margin-bottom: 0;
    }

    .accordion > details:last-of-type {
        border-radius: 0 0 4px 4px;
        margin-top: 0;
    }

    .accordion > details:not(:last-of-type) {
        border-bottom: 0;
    }

    .accordion > details:not(:first-of-type):not(:last-of-type) {
        border-radius: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
</style>
<div class="accordion">
    <details class="card">
        <summary class="card-action">Details element 1</summary>
        <div class="card-content pt-0">..</div>
    </details>
    <details class="card">
        <summary class="card-action">Details element 2</summary>
        <div class="card-content pt-0">..</div>
    </details>
    <details class="card">
        <summary class="card-action">Details element 3</summary>
        <div class="card-content pt-0">..</div>
    </details>
</div>

Keywords

FAQs

Package last updated on 09 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc